-- liquibase formatted sql

-- changeSet Vladislav:3

create table attribute(
  id int generated by default as identity primary key,
  name varchar not null,
  h_name varchar not null,
  data_type varchar not null,
  description varchar,
  creation_date timestamp without time zone
);

create table attribute_layer(
    layer_id int references layer(id) on delete cascade not null,
    attribute_id int references attribute(id) on delete cascade not null,
    PRIMARY KEY (layer_id, attribute_id)
);

-- rollback drop table attribute_layer;
-- rollback drop table attribute;